export const isObject = (headers: any) => {
  return (
    typeof headers === "object" &&
    headers instanceof Object &&
    headers.constructor === Object &&
    Object.getPrototypeOf(headers) === Object.prototype &&
    Object.prototype.toString.call(headers) === "[object Object]"
  );
};
export const excludeProperties = (
  object: Object,
  properties: string | number | Array<string | number> = []
) => {
  if (!isObject(object)) return object;
  const r = { ...object };
  return (
    Array.isArray(properties)
      ? properties.forEach((f) => {
          Reflect.has(r, f) && delete (r as any)[f];
        })
      : delete (r as any)[properties],
    r
  );
};
